﻿using System.Globalization;
using System.Windows.Data;
using VideoTools.SubtitleEdit.Common;

namespace VideoTools.Converters
{
    public class TimeCodeConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null) return "";
            if (value is TimeCode tc) 
            {
                return tc.ToShortString();
            }
            return "";
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
